<?php 
$show_validator = true;
include TMPL_PATH.'public/header.phtml';
?>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <a href='<?php echo U('order/order_delivery_list');?>' ><em>发货单列表</em></a><span>|</span>
        <a href='javascript:;' class="on"><em>发货单信息</em></a></div>
</div>

<style type='text/css'>
.table_form tbody td{ border: 1px solid #EEEEEE;}
.division {
    background: none repeat scroll 0 0 #FFFFFF;
    border-color: #CCCCCC #BEC6CE #BEC6CE #CCCCCC;
    border-style: solid;
    border-width: 1px 2px 2px 1px;
    line-height: 150%;
    white-space: normal;
}
.division table {
    margin: 0;
    padding: 0;
}
.division th, .division td {
    border-color: #FFFFFF #DBE2E7 #DDDDDD #FFFFFF;
    border-left: 1px solid #FFFFFF;
    border-right: 1px solid #DBE2E7;
    border-style: solid;
    border-width: 1px;
    padding: 5px;
    vertical-align: top;
}
.division th {
    background: none repeat scroll 0 0 #E2E8EB;
    border-right: 1px solid #CCCCCC;
    font-size: 14px;
    text-align: right;
    white-space: nowrap;
    width: 140px;
}
.gridlist th{
	text-align:center;
	font-weight: bold;
	font-size: 12px;
}
.order_th{font-size: 14px; color: rgb(0, 0, 0); font-weight: bold; margin: 10px;overflow:hidden;}
</style>

<div class="pad-10" style="padding-top:0px;">
<form name="myform" id="myform" action="__SELF__" method="post">
<input type="hidden" value="<?php echo $order['id']?>" name="id" id="order_id">
<div class="col-tab">
<div class="order_th">基本信息</div>
<div id="div_setting_1" class="contentList division pad-10">
<table width="100%" class="table_form">
	<tbody>
	<tr> 
		<th>发货单流水号：</th> 
		<td><?php echo $delivery['delivery_sn']?></td> 
		<th>下单日期：</th> 
		<td><?php echo date('Y-m-d H:i:s', $delivery['add_time']);?></td>
	</tr> 
	<tr> 
		<th>订单号：</th> 
		<td><?php echo $order['order_sn']?></td> 
		<th>下单日期：</th> 
		<td><?php echo date('Y-m-d H:i:s', $order['start_time']);?></td>
	</tr> 
	<tr>
		<th>配送方式：</th> 
		<td><?php echo $order['shipping_method_name']?></td>
		<th>配送费用：</th> 
		<td> <?php echo $order['shipping_fee']?></td>
	</tr>
	<tr>
		<th>物流编号：</th> 
		<td><input class="input-text" type="text" name="shipping_no" value="<?php echo $delivery['shipping_no'] ? $delivery['shipping_no']:null;?>" /></td>
		<th></th> 
		<td></td>
	</tr> 
	</tbody>
</table>
</div>

<div class="order_th">收货人信息</div>
<div id="div_setting_4" class="contentList division pad-10 ">
<table width="100%" cellspacing="0" cellpadding="0" border="0" class="table_form"> 
	<tbody>
	<tr> 
		<th>收货人姓：</th> 
		<td><?php echo $order['delivery_first_name'];?></td>
		<th>收货人名：</th> 
		<td><?php echo $order['delivery_last_name'];?></td>
	</tr> 
	<tr>
		<th>联系手机：</th> 
		<td><?php echo $order['delivery_mobile'];?></td>
	 <th>联系电话：</th> 
	 <td><?php echo $order['delivery_phone'];?></td> 
	</tr> 
	<tr>
		<th>Email地址：</th> 
	 <td><?php echo $order['delivery_email'];?></td> 
	 <th>邮政编码：</th> 
	 <td><?php echo $order['delivery_postcode'];?></td> 
	</tr> 
	<tr>
	 <th>收货地区：</th> 
	 		<td id="area" colspan="3"><?php echo $order['delivery_country'];?></td>
 	</tr> 
 	<tr>
 		<th>收货地址：</th> 
 		<td><?php echo $order['delivery_address'];?></td> 
 		<th>送货地址2：</th> 
	 <td><?php echo $order['delivery_address2'];?></td> 
 	</tr>
 	<tr>
 		<th>收货地址3：</th> 
 		<td><?php echo $order['delivery_address3'];?></td> 
 		<th>送货时间：</th> 
	 <td><?php echo $order['delivery_time'];?></td> 
 	</tr>
 </tbody>
</table>
</div>
<div class="order_th">商品信息 </div>
<div id="div_setting_2" class="contentList division pad-10">
<div class="table-grid" style="border: 1px solid #efefef;">
	<table width="100%" cellspacing="0" cellpadding="2" border="0" class="gridlist" id="order_items"> 
		<thead> 
			<tr>
			 <th style="width:150px;">货号</th> 
			 <th style="width:300px;">商品名称</th> 
			 <th style="width:100px;">库存</th>
			 <th style="width:100px;">购买总数量</th>
			 <th style="width:100px;">此单发货数量</th>
			</tr> 
		</thead> 
		<tbody>
		<?php 
		if(isset($order['productList']) && $order['productList']):
			foreach ($order['productList'] as $product):
				if(0 == $product['send_number']) continue;
		?>
			<tr>
				<td align="center"><?php echo $product['product_sn'];?></td> 
				<td><?php echo $product['product_name'];if($product['attr']){echo ' ( '. $product['attr'] . ' )';}?></td> 
				<td align="center"><?php echo $product['stock'];?></td> 
				<td align="center"><?php echo $product['qty'];?></td> 
				<td align="center"><?php echo $product['send_number'];?></td> 
			</tr>
		<?php 
			endforeach;
		endif;
		?>
		</tbody> 
	</table> 
</div>
</div>
<?php if($delivery['status'] != 3){?>
 <div class="bk15"></div>
<table width="100%" cellspacing="0" cellpadding="2" border="0" class="gridlist">
	 <tbody>
	 <tr>
	 		<th>订单操作备注：</th>
			<td>
				<textarea rows="3" cols="100" name="action_notice"></textarea>
			</td>
		</tr>
	 	</tbody>
	</table>  
 <div class="bk15"></div>
 	<?php if($delivery['status']==2){?>
 		<input type="hidden" name="cancel" value="1">
 		<input name="dosubmit" type="submit" value="取消发货" class="button">
 	<?php }elseif($delivery['status']==1){?>
    <input name="dosubmit" type="submit" value="发货" class="button">
  <?php }?>
<?php }?>
</form>
</div>
<div class="bk15"></div>
<div id="div_setting_5" class="contentList division pad-10">
	<table width="100%" cellspacing="0" cellpadding="0" border="0" class="gridlist"> 
		<thead>
		 <tr>
		  <th style="width:50px;">操作者</th>
		  <th style="width:150px;">操作时间</th>
		  <th style="width:50px;">订单状态</th>
		  <th style="width:50px;">支付状态</th>
		  <th style="width:100px;">配送状态</th>
		  <th style="width:500px;">备注</th>
		 </tr> 
		</thead> 
		<tbody>
		<?php 
			if(isset($order['logs']) && $order['logs']):
				foreach ($order['logs'] as $log):
		?>
		  <tr>
		   <td align="center"><?php echo $log['action_name'];?></td> 
		   <td align="center"><?php echo date('Y-m-d H:i:s', $log['action_time']);?></td> 
		   <td align="center"><?php echo OrderModel::$orderStatusCn[$log['order_status']];?></td> 
		   <td align="center"><?php echo OrderModel::$paymentStatus[$log['payment_status']];?></td> 
		   <td align="center"><?php echo $log['shipping_status']==99 ? '配货中' : OrderModel::$shippingStatus[$log['shipping_status']];?></td> 
		   <td><?php echo $log['action_notice'];?></td> 
		  </tr>
		<?php 
				endforeach;
			endif;
		?>
		</tbody> 
	</table>
</div>
</div>
</body>
</html>

